package pl.bristleback.server.bristle.exceptions.handlers;

import org.jwebsocket.api.WebSocketConnector;
import org.jwebsocket.token.Token;

import java.util.Set;

/**
 * This interface should be implemented by action classes,
 * when missing user rights should be handled by a server in some special way,
 * for example user can be informed about error occurred.
 * <p/>
 * Created on: 2010-11-08 10:01:56 <br/>
 *
 * @author Wojciech Niemiec
 */
public interface MissingRightsErrorHandler {

  /**
   * Handles missing connector rights error. If necessary, method can check which rights are missing.
   *
   * @param requiredRights rights required by action class implementing this interface.
   * @param connector      websocket connector.
   * @param token          content of the message.
   */
  void handleMissingRightsError(Set<String> requiredRights, WebSocketConnector connector, Token token);
}
